<%@page import="com.wanmait.movies.vo.MovieCountry"%>
<%@page import="com.wanmait.movies.vo.MovieLanguage"%>
<%@page import="com.wanmait.movies.vo.MovieType"%>
<%@page import="com.wanmait.movies.vo.Director"%>
<%@page import="com.wanmait.movies.vo.Actor"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    
    <%int actorCount =(int)request.getAttribute("actorCount");
      int directorCount =(int)request.getAttribute("directorCount");%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="/movies/js/jquery-3.5.1.min.js"></script>
<script type="text/javascript">
	$(function(){
		
		$("#prevactor").click(function(){
			var page = $("#prevactor").next().attr("pager");
			page =parseInt(page);
			page--;
			if(page>0){
				$.ajax({
					url:"/movies/ManegerServlet?action=getActorList",
					async:false,
					type:"get",
					data:"page="+page,
					success:function(s){
						$("#actorlist").children().remove();
						$("#actorlist").html(s);
						$("#prevactor").next().val(page);
						$("#prevactor").next().attr("pager",page);
					}
				});
			}
			
		});
	});
	
	$(function(){
		$("#nextactor").click(function(){
			var page = $("#nextactor").prev().attr("pager");
			page =parseInt(page);
			page++;
			
			if(page<=<%=(actorCount+7)/8%>){
				$.ajax({
					url:"/movies/ManegerServlet?action=getActorList",
					async:false,
					type:"get",
					data:"page="+page,
					success:function(s){
						$("#actorlist").children().remove();
						$("#actorlist").html(s);
						$("#nextactor").prev().val(page);
						$("#prevactor").next().attr("pager",page);
					}
				});
			}
			
		});
	});
	
	
	$(function(){
		$("#prevdirector").click(function(){
			var page = $("#prevdirector").next().attr("pager");
			page =parseInt(page);
			page--;
			if(page>0){
				$.ajax({
					url:"/movies/ManegerServlet?action=getDirectorList",
					async:false,
					type:"get",
					data:"page="+page,
					success:function(s){
						$("#directorlist").children().remove();
						$("#directorlist").html(s);
						$("#prevdirector").next().val(page);
						$("#prevdirector").next().attr("pager",page);
					}
				});
			}
			
		});
	});
	
	$(function(){
		$("#nextdirector").click(function(){
			var page = $("#nextdirector").prev().attr("pager");
			page =parseInt(page);
			page++;
			
			if(page<=<%=(directorCount+7)/8%>){
				$.ajax({
					url:"/movies/ManegerServlet?action=getDirectorList",
					async:false,
					type:"get",
					data:"page="+page,
					success:function(s){
						$("#directorlist").children().remove();
						$("#directorlist").html(s);
						$("#nextdirector").prev().val(page);
						$("#prevdirector").prev().attr("pager",page);
					}
				});
			}
			
		});
	});
	
	$(function(){
		$("#acpage").keydown(function(e){
			var ev =window.event||e;
			
			if(ev.which==13){
				var page = $("#acpage").val();
				var z =/^[1-9]\d*$/;
				
				var flag=z.test(page);
				if(flag){
					page =parseInt(page);
					if(page>0&&page<=<%=(actorCount+7)/8%>){
						$.ajax({
							url:"/movies/ManegerServlet?action=getActorList",
							async:false,
							type:"get",
							data:"page="+page,
							success:function(s){
								$("#actorlist").children().remove();
								$("#actorlist").html(s);
								$("#acpage").val(page);
								$("#acpage").attr("pager",page);
							}
						});
					}else{
						$("#acpage").val($("#acpage").attr("pager"));	
					}
				}else{
					   $("#acpage").val($("#acpage").attr("pager"));	
					
				}
				
			}
		});
	});
	
	
	$(function(){
		$("#dipage").keydown(function(e){
			var ev =window.event||e;
			
			if(ev.which==13){
				var page = $("#dipage").val();
				var z =/^[1-9]\d*$/;
				
				var flag=z.test(page);
				if(flag){
					page =parseInt(page);
					if(page>0&&page<=<%=(directorCount+7)/8%>){
						$.ajax({
							url:"/movies/ManegerServlet?action=getDirectorList",
							async:false,
							type:"get",
							data:"page="+page,
							success:function(s){
								$("#directorlist").children().remove();
								$("#directorlist").html(s);
								$("#dipage").val(page);
								$("#dipage").attr("pager",page);
							}
						});
					}else{
						$("#dipage").val($("#dipage").attr("pager"));	
					}
				}else{
					    $("#dipage").val($("#dipage").attr("pager"));	
					
				}
				
			}
		});
	});
	
	$(function(){
		$("#inputactor").click(function(){
			var name =$("#inputactor").prev().val();
			
			$.ajax({
				url:"/movies/ManegerServlet?action=findActor",
				async:false,
				type:"get",
				data:"name="+name,
				success:function(s){
					if(s=="0"){
						
					}else{
						$("#actorlist").children().remove();
						var l = JSON.parse(s);
						for(var i=0;i<l.length;i++){
							var li =$("<li aid="+l[i].id+"></li>");
							var sp1=$("<span><img src='/movies/images/"+l[i].actorImage+"'></span>");
							var sp2=$("<span>"+l[i].actorName+"</span>");
							var sp3=$("<span><a href=\"javascript:void(0);\" class='a1'>删除</a> <a href='javascript:void(0);' class='a2'>修改</a></span>");
							li.append(sp1);
							li.append(sp2);
							li.append(sp3);
							$("#actorlist").append(li);
						}
						$("#seeapage").css("display","none");
					}
				}
			});
			
		});
		
	});
	
	
	$(function(){
		$("#inputdirector").click(function(){
			var name =$("#inputdirector").prev().val();
			
			$.ajax({
				url:"/movies/ManegerServlet?action=findDirector",
				async:false,
				type:"get",
				data:"name="+name,
				success:function(s){
					if(s=="0"){
						
					}else{
						$("#directorlist").children().remove();
						var l = JSON.parse(s);
						for(var i=0;i<l.length;i++){
							
							var li =$("<li aid="+l[i].id+"></li>");
							var sp1=$("<span><img src='/movies/images/"+l[i].directorImage+"'></span>");
							var sp2=$("<span>"+l[i].directorName+"</span>");
							var sp3=$("<span><a href=\"javascript:void(0);\" class='a1'>删除</a> <a href='javascript:void(0);' class='a2'>修改</a></span>");
							li.append(sp1);
							li.append(sp2);
							li.append(sp3);
							$("#directorlist").append(li);
						}
						$("#seedpage").css("display","none");
					}
				}
			});
			
		});
		
	});
	
	//聚焦
	$(function(){
		$("#actortext").focus(function(){
			$("#actortext").val("");
				$.ajax({
					url:"/movies/ManegerServlet?action=getActorList",
					async:false,
					type:"get",
					data:"page=1",
					success:function(s){
						$("#actorlist").children().remove();
						$("#actorlist").html(s);
						$("#acpage").val("1");
						$("#acpage").attr("pager","1");
						$("#seeapage").css("display","block");
					}
				});
			
		});
	});
	
	$(function(){
		$("#directortext").focus(function(){
			$("#directortext").val("");
				$.ajax({
					url:"/movies/ManegerServlet?action=getDirectorList",
					async:false,
					type:"get",
					data:"page=1",
					success:function(s){
						$("#directorlist").children().remove();
						$("#directorlist").html(s);
						$("#dipage").val("1");
						$("#dipage").attr("pager","1");
						$("#seedpage").css("display","block");
					}
				});
			
		});
	});
	//删除
	$(function(){
		$("#actor").on("click",".a1",function(){
		    var id=	$(this).parent().parent().attr("aid");
		    var page = $("#acpage").val();
			
				$.ajax({
					url:"/movies/ManegerServlet?action=getActorList",
					async:false,
					type:"get",
					data:"page="+page+"&id="+id,
					success:function(s){
						$("#actorlist").children().remove();
						$("#actorlist").html(s);
						$("#acpage").val(page);
						$("#acpage").attr("pager",page);
					}
				});
		})
	});
	
	$(function(){
		$("#director").on("click",".a1",function(){
		    var id=	$(this).parent().parent().attr("aid");
		    var page = $("#dipage").val();
			
				$.ajax({
					url:"/movies/ManegerServlet?action=getDirectorList",
					async:false,
					type:"get",
					data:"page="+page+"&id="+id,
					success:function(s){
						$("#directorlist").children().remove();
						$("#directorlist").html(s);
						$("#dipage").val(page);
						$("#dipage").attr("pager",page);
					}
				});
		})
	});
	
	//样式
	$(function(){
		$("#l1").click(function(){
			$("#l1").css("font-weight","bold");	
			$("#l2").css("font-weight","normal")
			$("#l3").css("font-weight","normal")
			$("#l4").css("font-weight","normal")
			$("#l5").css("font-weight","normal")
			
			$("#actor").css("display","block");
			$("#director").css("display","none");
			$("#type").css("display","none");
			$("#language").css("display","none");
			$("#country").css("display","none");
			
			$("#l1").css("background-color","lightgray");	
			$("#l2").css("background-color","#f5f5f5")
			$("#l3").css("background-color","#f5f5f5")
			$("#l4").css("background-color","#f5f5f5")
			$("#l5").css("background-color","#f5f5f5")
		});
	});
	
	$(function(){
		$("#l2").click(function(){
			$("#l2").css("font-weight","bold");	
			$("#l1").css("font-weight","normal")
			$("#l3").css("font-weight","normal")
			$("#l4").css("font-weight","normal")
			$("#l5").css("font-weight","normal")
			
			$("#director").css("display","block");
			$("#actor").css("display","none");
			$("#type").css("display","none");
			$("#language").css("display","none");
			$("#country").css("display","none");
			
			$("#l2").css("background-color","lightgray");	
			$("#l1").css("background-color","#f5f5f5")
			$("#l3").css("background-color","#f5f5f5")
			$("#l4").css("background-color","#f5f5f5")
			$("#l5").css("background-color","#f5f5f5")
		});
	});
	
	$(function(){
		$("#l3").click(function(){
			$("#l3").css("font-weight","bold");	
			$("#l2").css("font-weight","normal")
			$("#l1").css("font-weight","normal")
			$("#l4").css("font-weight","normal")
			$("#l5").css("font-weight","normal")

			$("#type").css("display","block");
			$("#director").css("display","none");
			$("#actor").css("display","none");
			$("#language").css("display","none");
			$("#country").css("display","none");
			
			$("#l3").css("background-color","lightgray");	
			$("#l2").css("background-color","#f5f5f5");
			$("#l1").css("background-color","#f5f5f5");
			$("#l4").css("background-color","#f5f5f5");
			$("#l5").css("background-color","#f5f5f5");
		});
	});
	
	$(function(){
		$("#l4").click(function(){
			$("#l4").css("font-weight","bold");	
			$("#l2").css("font-weight","normal")
			$("#l1").css("font-weight","normal")
			$("#l5").css("font-weight","normal")
			$("#l3").css("font-weight","normal")
			
			$("#language").css("display","block");
			$("#director").css("display","none");
			$("#type").css("display","none");
			$("#actor").css("display","none");
			$("#country").css("display","none");
			
			$("#l4").css("background-color","lightgray");	
			$("#l2").css("background-color","#f5f5f5");
			$("#l1").css("background-color","#f5f5f5");
			$("#l3").css("background-color","#f5f5f5");
			$("#l5").css("background-color","#f5f5f5");
		});
	});
	
	$(function(){
		$("#l5").click(function(){
			$("#l5").css("font-weight","bold");	
			$("#l2").css("font-weight","normal")
			$("#l3").css("font-weight","normal")
			$("#l4").css("font-weight","normal")
			$("#l1").css("font-weight","normal")
			
			$("#country").css("display","block");
			$("#director").css("display","none");
			$("#type").css("display","none");
			$("#language").css("display","none");
			$("#actor").css("display","none");
			
			$("#l5").css("background-color","lightgray");	
			$("#l1").css("background-color","#f5f5f5")
			$("#l2").css("background-color","#f5f5f5")
			$("#l3").css("background-color","#f5f5f5")
			$("#l4").css("background-color","#f5f5f5")
		});
	});
	
	$(function(){
		$("#modifyDirector input[type=text],#modifyActor input[type=text],#modifyCountry input[type=text],#modifyType input[type=text],#modifyLanguage input[type=text]").css("width","100px");
		$("#modifyDirector input[type=text],#modifyActor input[type=text],#modifyCountry input[type=text],#modifyType input[type=text],#modifyLanguage input[type=text]").css("border","1px solid gray");
		$("#modifyDirector input[type=text],#modifyActor input[type=text],#modifyCountry input[type=text],#modifyType input[type=text],#modifyLanguage input[type=text]").css("border-radius","5px");
		$("#modifyDirector input[type=submit],#modifyActor input[type=submit],#modifyCountry input[type=submit],#modifyType input[type=submit],#modifyLanguage input[type=submit]").css("background-color","white");
		$("#modifyDirector input[type=submit],#modifyActor input[type=submit],#modifyCountry input[type=submit],#modifyType input[type=submit],#modifyLanguage input[type=submit]").css("border-radius","2px");
		$("#modifyDirector input[type=submit],#modifyActor input[type=submit],#modifyCountry input[type=submit],#modifyType input[type=submit],#modifyLanguage input[type=submit]").css("border","1px");
		$("#modifyDirector input[type=submit],#modifyActor input[type=submit],#modifyCountry input[type=submit],#modifyType input[type=submit],#modifyLanguage input[type=submit]").css("margin-left","160px");
		$("#modifyDirector input[type=submit],#modifyActor input[type=submit],#modifyCountry input[type=submit],#modifyType input[type=submit],#modifyLanguage input[type=submit]").css("margin-bottom","10px");
		$(".closeit").css("margin-left","370px");
	});
	//修改
	$(function(){
		$("#actor").on("click",".a2",function(){
			var aid =$(this).parent().parent().attr("aid");
		
			$.ajax({
				url:"/movies/ManegerServlet",
				async:false,
				type:"get",
				data:"aid="+aid+"&action=findActorById",
				success:function(s){
				
					var actor =JSON.parse(s);
					$("#aname").val(actor.actorName);
					
					var img =$("<img src='/movies/images/"+actor.actorImage+"'>");
					$("#aimage").html("");
					$("#aimage").append(img);
					$("#ahidden").val(aid);
					$("#aintr").val(actor.actorIntroduce);
					$("#modifyActor").css("display","block");
				}
			});
		});
	})
	
	$(function(){
		$("#director").on("click",".a2",function(){
			var aid =$(this).parent().parent().attr("aid");
			
			$.ajax({
				url:"/movies/ManegerServlet?action=findDirectorById",
				async:false,
				type:"get",
				data:"aid="+aid,
				success:function(s){
					var director =JSON.parse(s);
					$("#dname").val(director.directorName);
					var img =$("<img src='/movies/images/"+director.directorImage+"'>");
					$("#dimage").html("");
					$("#dimage").append(img);
					$("#dhidden").val(aid);
					$("#dintr").val(director.directorIntroduce);
					$("#modifyDirector").css("display","block");
				}
			});
		});
	})
	$(function(){
		$("#language").on("click",".a2",function(){
			var aid =$(this).parent().parent().attr("aid");
			
			$.ajax({
				url:"/movies/ManegerServlet?action=findLanguageById",
				async:false,
				type:"get",
				data:"aid="+aid,
				success:function(s){
					var language =JSON.parse(s);
					$("#lname").val(language.languageType);
					
					$("#lhidden").val(aid);
					$("#modifyLanguage").css("display","block");
				}
			});
		});
	})
	$(function(){
		$("#type").on("click",".a2",function(){
			var aid =$(this).parent().parent().attr("aid");
			
			$.ajax({
				url:"/movies/ManegerServlet?action=findTypeById",
				async:false,
				type:"get",
				data:"aid="+aid,
				success:function(s){
					var type =JSON.parse(s);
					$("#tname").val(type.movieType);
					
					$("#thidden").val(aid);
					$("#modifyType").css("display","block");
				}
			});
		});
	});
	$(function(){
		$("#country").on("click",".a2",function(){
			var aid =$(this).parent().parent().attr("aid");
			
			$.ajax({
				url:"/movies/ManegerServlet?action=findCountryById",
				async:false,
				type:"get",
				data:"aid="+aid,
				success:function(s){
					var country =JSON.parse(s);
					$("#cname").val(country.country);
					
					$("#chidden").val(aid);
					$("#modifyCountry").css("display","block");
				}
			});
		});
	})
	$(function(){
		$("#modifyActor").on("click",".closeit",function(){
			var aid =$(this).parent().css("display","none");
		});
	})
	
	$(function(){
		$("#modifyDirector").on("click",".closeit",function(){
			var aid =$(this).parent().css("display","none");
		});
	})
	
	
	$(function(){
		$("#modifyLanguage").on("click",".closeit",function(){
			var aid =$(this).parent().css("display","none");
		});
	})
	
	$(function(){
		$("#modifyType").on("click",".closeit",function(){
			var aid =$(this).parent().css("display","none");
		});
	})
	
	$(function(){
		$("#modifyCountry").on("click",".closeit",function(){
			var aid =$(this).parent().css("display","none");
		});
	})
	
	
//上传图片预览
		function getObjectURL(file) {
		  var url = null ;
		  if (window.createObjectURL!=undefined) 
		  { // basic
		   url = window.createObjectURL(file) ;
		  }
		  else if (window.URL!=undefined) 
		  {
		   // mozilla(firefox)
		   url = window.URL.createObjectURL(file) ;
		  } 
		  else if (window.webkitURL!=undefined) {
		   // webkit or chrome
		   url = window.webkitURL.createObjectURL(file) ;
		  }
		  return url ;
	 }
	
	$(function(){
		$(".aimage").click(function () {
			$(".aimage").on("change",function(){
				var objUrl = getObjectURL(this.files[0]) ;
				 console.log("objUrl = "+objUrl) ;
				 $("#aimage").html("");
				var img =$("<img src="+objUrl+">");
				$("#aimage").append(img);
			})
			
		});
	});
	
	$(function(){
		$(".dimage").click(function () {
			$(".dimage").on("change",function(){
				var objUrl = getObjectURL(this.files[0]) ;
				 console.log("objUrl = "+objUrl) ;
				 $("#dimage").html("");
				var img =$("<img src="+objUrl+">");
				$("#dimage").append(img);
			})
			
		});
	});
	
</script>
<style type="text/css">
	#modifyActor ,#modifyLanguage,#modifyType,#modifyCountry{
		display:none;
		width:400px;
		border:1px black solid;
		border-radius: 5px;
		margin-left:250px;
		margin-top:100px;
		position:absolute;
		z-index:3;
		background: rgba(240,240,240,0.9);
		padding-left:20px;
		font-weight: bold;
		color:black;
	}
	.closeit{
		width:20px;
		color:black;
	}
	#modifyDirector{
		display:none;
		width:400px;
		border:1px black solid;
		border-radius: 5px;
		margin-left:250px;
		margin-top:100px;
		position:absolute;
		z-index:3;
		background: rgba(240,240,240,0.9);
		padding-left:20px;
		font-weight: bold;
	}
	
	#modifyActor img{
		width:80px;
		height:100px;
	}
	#modifyDirector img{
		width:80px;
		height:100px;
	}
	#actor{
	width:600px;
	margin:auto;
	
	}
	#director{
	width:600px;
	margin:auto;
	display:none;
	}
	#language,#type,#country{
	width:400px;
	margin:auto;
	display:none;
	}
	body{
		background-color: white;
		font-weight: 300;
	}
	ul{
		list-style: none;
		margin:0px;
		padding:0px;
	}
	#title{
		width:800px;
		padding-left:80px;
		overflow: hidden;
		margin:20px 0px;
	}
	#title>li>a{
	    color:black;
	    font-size:18px;
	    text-decoration: none;
	}
	#title>li{
		float:left;
		width:159px;
		height:30px;
		line-height: 30px;
		font-size:20px;
		border-left:1px solid white;
		background-color: #f5f5f5;
		text-align: center;
		border-radius: 5px;
	}
	#title>li:hover{
		background-color: lightgray;
	}
	ul img{
		width:80px;
		height:100px;
	
	}
	li span{
		display: table-cell;
		width:198px;
		text-align: center;
		border: 1px solid gray;
		vertical-align: middle;
	}
	
	body>div{
	    width:600px;
		margin:auto;
	}
	.input{
	    width:600px;
		text-align: center;
		margin:10px 0px;
	}
	ul a{
	    text-decoration: none;
	    color:red;
	}
	a{
		text-decoration: none;
	    font-size: 15px;
	}

	#seeapage,#seedpage{
		width:300px;
		margin-left:230px;
	}
	
	#acpage, #dipage{
		width:20px;
	}
	
	
	#actortext,#directortext{
		border:1px solid gray;
		border-radius: 5px;
		width:150px;
		margin:0px 20px;
	}
	.a2:link{
		color:green;
	}
	#inputactor,#inputdirector{
		background-color: white;
		border-radius: 5px;
	}
	#l1{
		font-weight:bold;
	}
	form{
	color:black;
	}
	.closeit a{
		color:red;
	}
</style>

</head>
<body>
	<ul id="title">
		<li id="l1"><a href="javascript:void(0);">演员</a></li>
		<li id="l2"><a href="javascript:void(0);">导演</a></li>
		<li id="l3"><a href="javascript:void(0);">类型</a></li>
		<li id="l4"><a href="javascript:void(0);">语言</a></li>
		<li id="l5"><a href="javascript:void(0);">地区</a></li>
	</ul>
	
	<div id="modifyActor">
	    <div class="closeit"><a href="javascript:void(0);">x</a></div>
		<form action="/movies/ManegerServlet?action=modifyActor" enctype="multipart/form-data" method="post">
			名字&nbsp;<input type="text" name="name" id="aname"><br><br>
			图片&nbsp;<input type=file name="image" class="aimage"><span id="aimage"></span><br><br>
			简介&nbsp;<textarea name ="introduce" id='aintr'>
	   			
	   		</textarea>	<br><br>
			<input type="hidden" id="ahidden" name="id">
			<input type="submit">
		</form>
	</div>
	
	<div id="modifyDirector">
	   <div  class="closeit"><a href="javascript:void(0);">x</a></div>
		<form action="/movies/ManegerServlet?action=modifyDirector" enctype="multipart/form-data" method="post">
			名字&nbsp;<input type="text" name="name" id="dname"><br><br>
			图片&nbsp;<input type=file name="image" class="dimage"><span id="dimage"></span><br><br>
			简介&nbsp;<textarea name ="introduce" id='dintr'>
	   			
	   		</textarea>	<br><br>
			<input type="hidden" id="dhidden" name="id">
			<input type="submit">
		</form>
	</div>
	
	<div id="modifyLanguage">
	  <div class="closeit"><a href="javascript:void(0);">x</a></div>
		<form action="/movies/ManegerServlet?action=modifyLanguage" enctype="multipart/form-data" method="post">
			名字&nbsp;<input type="text" name="name" id="lname"><br><br>
			<input type="hidden" id="lhidden" name="id">
			<input type="submit">
		</form>
	</div>
	
	<div id="modifyType">
	   <div class="closeit"><a href="javascript:void(0);">x</a></div>
		<form action="/movies/ManegerServlet?action=modifyType" enctype="multipart/form-data" method="post">
			名字&nbsp;<input type="text" name="name" id="tname"><br><br>
			<input type="hidden" id="thidden" name="id">
			<input type="submit">
		</form>
	</div>
	
	<div id="modifyCountry"> 
	   <div class="closeit"><a href="javascript:void(0);">x</a></div>
		<form action="/movies/ManegerServlet?action=modifyCountry" enctype="multipart/form-data" method="post">
			名字&nbsp;<input type="text" name="name" id="cname"><br><br>
			<input type="hidden" id="chidden" name="id">
			<input type="submit">
		</form>
	</div>
	
	<div id="actor">
		
		<% ArrayList<Actor> actorList= (ArrayList<Actor>)request.getAttribute("actorList"); %>
		<div class="input">演员<input type="text" id="actortext"><input type="button" value="搜索" id="inputactor"></div>
		<ul id="actorlist">
			<%for(Actor actor:actorList){%>
				<li aid="<%=actor.getId() %>">
					<span><img src="/movies/images/<%=actor.getActorImage() %>"></span>
					<span><%=actor.getActorName()%></span>
					<span><a href="javascript:void(0);" class="a1">删除</a>
						  <a href="javascript:void(0);" class="a2">修改</a>
					</span>
				</li>
			<%} %>
			
		</ul>
		<div id="seeapage">
			<a href="javascript:void(0);" id="prevactor">上一页</a>
			<input type="text" value="1" id="acpage" pager="1">
			<a href="javascript:void(0);" id="nextactor">下一页</a>
		</div>
	</div>
	
	<div id="director">
		
		<% ArrayList<Director> directorList= (ArrayList<Director>)request.getAttribute("directorList"); %>
		<div class="input">导演<input type="text" id="directortext"><input type="button" value="搜索" id="inputdirector"></div>
		<ul id="directorlist">
			<%for(Director director:directorList){%>
				<li aid="<%=director.getId() %>">
					<span><img src="/movies/images/<%=director.getDirectorImage() %>"></span>
					<span><%=director.getDirectorName()%></span>
					<span><a href="javascript:void(0);" class="a1">删除</a>
						  <a href="javascript:void(0);" class="a2">修改</a>
					</span>
				</li>
			<%} %>
			
		</ul>
		<div id="seedpage">
			<a href="javascript:void(0);" id="prevdirector">上一页</a>
			<input type="text" value="1" id="dipage" pager="1">
			<a href="javascript:void(0);" id="nextdirector">下一页</a>
		</div>
	</div>
	
	<div id="type">
		<% ArrayList<MovieType> typeList= (ArrayList<MovieType>)request.getAttribute("typeList"); %>
		<ul id="typelist">
			<%for(MovieType type:typeList){%>
				<li aid="<%=type.getId() %>">
					<span><%=type.getMovieType()%></span>
					<span><a href="javascript:void(0);" class="a2">修改</a></span>
				</li>
			<%} %>
		</ul>
	</div>
	
	<div id="language">
		<% ArrayList<MovieLanguage> languageList= (ArrayList<MovieLanguage>)request.getAttribute("languageList"); %>
		<ul id="lanugagelist">
		<%for(MovieLanguage movieLanguage:languageList){%>
				<li aid="<%=movieLanguage.getId() %>">
					<span><%=movieLanguage.getLanguageType()%></span>
					<span><a href="javascript:void(0);" class="a2">修改</a></span>
				</li>
			<%} %>
		</ul>
	</div>
	
	<div id="country">
		<% ArrayList<MovieCountry> countryList= (ArrayList<MovieCountry>)request.getAttribute("countryList"); %>
		<ul id="countrylist">
		<%for(MovieCountry movieCountry:countryList){%>
				<li aid="<%=movieCountry.getId() %>">
					<span><%=movieCountry.getCountry()%></span>
					<span><a href="javascript:void(0);" class="a2">修改</a></span>
				</li>
			<%} %>
		</ul>
	</div>
</body>
</html>